package com.hc.ex;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * 自定义异常
 *
 * @author hecai
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class ModelAndViewException extends RuntimeException {
    private static final long serialVersionUID = -8026823680962105189L;
    /**
     * 异常错误编码
      */

    private Integer code;

    /**
     * 异常信息
     */
    private String msg;

    public static ModelAndViewException transfer(GlobalException e) {
        ModelAndViewException exception = new ModelAndViewException(e.getCode(),e.getMsg());
        return exception;
    }

}
